﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace T06ArrayType
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] array1 = new int[10];
            int[] array2 = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

            for (int j = 0; j < array1.Length; j++)
            {
                array1[j] = (j + 1) * 10;
            }

            foreach (int _x in array2)
            {
                Console.WriteLine($"{_x}\t");
            }
            Console.WriteLine("==================一堆数组==================");

            Console.WriteLine(array1.Max());
            Console.WriteLine(array1.Min());
            foreach (int _x  in array1.Reverse())
            {
                Console.WriteLine($"{_x}\t");

            }
            Console.WriteLine("========================Array包装类=========================");

            int[,] array3 = new int[3, 4];
            int[,,] array4 = new int[3, 4, 5];
            for (int i = 0; i < array3.GetLength(0); i++)
            {
                for (int j = 0; j < array3.GetLength(1); j++)
                {
                    array3[i,j]= (i + 1) * (j + 1);
                    Console.WriteLine($"{array3[i,j]}\t");
                }
                Console.WriteLine();
            }
            Console.WriteLine("========================多维数组=========================");

            int[][] array5 = new int[3][];

            //初始化
            //for (int = 0; int < 3; int++) ;
            //{
            //    array5[i] = new int[4];
            //}
            array5[0] = new int[2] { 1, 2 };
            array5[1] = new int[3] { 3, 4, 5 };
            array5[2] = new int[4] { 6, 7, 8, 9 };

            foreach (int[] arr in array5)
            {
                foreach (int _x in arr)
                {
                    Console.Write($"{_x}\t");

                }
            }
            Console.WriteLine();
            Console.WriteLine("========================数组的数组=========================");
            /*
             * 快捷键
             * ctrl+m,m折叠代码
             * ctrl+k,c行添加注释
             * ctrl+k,u行取消注释
             * ctrl+k+d格式化代码
             */



            Console.ReadKey();
        }
    }
}
